Component({
    methods: {
        goback: function() {
            1 === getCurrentPages().length ? wx.switchTab({
                url: "/pages/index/index"
            }) : wx.navigateBack();
        }
    }
});